#include <gui/healthpage_screen/HealthPageView.hpp>
#include <gui/healthpage_screen/HealthPagePresenter.hpp>

HealthPagePresenter::HealthPagePresenter(HealthPageView& v)
    : view(v)
{

}

void HealthPagePresenter::activate()
{
	HealthPageViewTask(true);
}

void HealthPagePresenter::deactivate()
{		
	HealthPageViewTask(false);
}
//HealthPagePresenter状态
void HealthPagePresenter::HealthPageViewTask(bool enable)
{
	if(enable == true)
		model->HealthPageViewTask(true);
	else
		model->HealthPageViewTask(false);
}
//健康监测信息上传
void HealthPagePresenter::updateHeartRateInfo(uint32_t newHeartRate, uint32_t newSPO2)
{
		view.updateHeartRateInfo(newHeartRate, newSPO2);
}
//物理按键的页面跳转
void HealthPagePresenter::HealthPageChange(uint8_t newFiveKeyFunc)
{
		view.HealthPageChange(newFiveKeyFunc);	
}